/*
 * 19.10
 * Write a method to generate a random number between 1 and 7, given a method
 * that generates a random number between 1 and 5 (i.e., implement rand7() using
 * rand5()).
 */
static int rand5();

static int rand7() {
    while (true) {
        /* generate [0, 24] */
        int num = 5 * (rand5() - 1) + (rand5() - 1);
        if (num < 21) {
            return (num % 7 + 1);
        }
    }
}

int main() {
    return 0;
}
